<?php

namespace app\admin\controller;
use app\api\logic\TrackLogic;
use  app\common\controller\DBase;
use app\common\controller\PCBase;
use app\order\logic\OrderShipServiceLogic;
use app\order\logic\OrderWhServiceLogic;
use app\checkbill\logic\BillLogic;
use app\checkbill\logic\BillQcLogic;
use app\checkbill\logic\CheckMonthFeeLogic;
use app\order\logic\OrderDocumentServiceLogic;
use  think\facade\Request;
use  app\admin\logic\TestLogic;
use  app\order\logic\OrderShipLogic;
use  app\admin\logic\TestTimeLogic;
use  app\systems\logic\MqTaskServiceLogic;
use  app\common\service\CommonSystemImportService;
use  app\common\service\CommonSystemImportDetailService;
use  think\App;
class Test extends DBase
{

    /**
     * @desc mq消息测试
     * @author xx
     * @date 2024-03-13
     */
    public function mqTest(){
        $data   = $this->request->post();
        return    (new TestLogic())->mqTest($data);
    }

    /**
     * @desc   本地上传OSS
     * @author xx
     * @date 2024-03-18
     */
    public function uploadTest(){
        $data   = $this->request->post();
        $res    = (new TestLogic())->uploadImage($data);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   本地上传excel
     * @author xx
     * @date 2024-03-18
     */
    public function uploadExcelTest(){
        $file   = $this->request->file('file');
        $tel    = $this->getAdminTel();
        $data['file'] = $file;
        $data['tel'] = $tel;
        return    (new TestLogic())->uploadExcelTest($data);
    }


    /**
     * @desc   本地上传excel
     * @author xx
     * @date 2024-03-18
     */
    public function uploadTimeExcelTest(){
        $file   = $this->request->file('file');
        $tel    = $this->getAdminTel();
        $data['file'] = $file;
        $data['tel'] = $tel;
        return    (new TestLogic())->uploadTimeExcelTest($data);
    }




    /**
     * @desc   详情数据写入表
     * @author xx
     * @date 2024-03-18
     */
    public function importTest(){
        $data   = $this->request->post();
         (new MqTaskServiceLogic())->sale_center_system_import_task_detail($data);
         return $this->jsonMessage(200, true, "推送成功!", null);
    }



    /**
     * @desc   测试消费详情表数据
     * @author xx
     * @date 2024-03-18
     */
    public function importTestInsert(){
        $data   = $this->request->post();
        $id     = getIsset($data,'id');
        $res = (new CommonSystemImportDetailService())->import_month_new($id);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }


    /**
     * @desc   测试消费详情表数据
     * @author xx
     * @date 2024-07-17
     */
    public function importTestInsertOld(){
        $data   = $this->request->post();
        $id     = getIsset($data,'id');
        $res = (new CommonSystemImportDetailService())->import_month_old($id);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }




    /**
     * @desc  测试写入表中
     * @author xx
     * @date 2024-03-18
     */
    public function importTestConsumer(){
        $data   = $this->request->post();
        $res = (new TestTimeLogic())->import_time_detail($data);
        return $this->jsonMessage(200, true, "推送成功!", null);
    }


    /**
     * @desc  测试更新导入表
     * @author xx
     * @date 2024-03-18
     */
    public function importTestUpdate(){
        $data   = $this->request->post();
        $res = (new CommonSystemImportService())->update_task_status();
      //  return $this->jsonMessage(200, true, "推送成功!", null);
    }


    /**
     * @desc   测试日志写入
     * @author xx
     * @date 2024-03-26
     */
    public function addLogTest(){
        $data   = $this->request->post();
        $res    = (new TestLogic())->addLogTest();
        return $this->jsonMessage(200, true, "推送成功!", null);
    }


    /**
     * @desc  测试订单发货
     * @author xx
     * @date  2024-03-29
     */
    public function testOrder(){
        $data   = $this->request->post();
        $res    =  (new OrderShipServiceLogic())->orderShippingQueueConsume($data);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }


    /**
     * @desc  测试网红订单发货
     * @author xx
     * @date  2024-03-30
     */
    public function testWhOrder(){
        $data   = $this->request->post();
        $res    =  (new OrderWhServiceLogic())->orderWhShippingQueueConsume($data);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }

    /**
     * @desc   测试jjs发货
     * @author xx
     * @date   2024-07-09
     */
    public function importSFProduce(){
        $data   = $this->request->post();
        $res    =  (new BillLogic())->importSFProduce($data);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }


    /**
     * @desc  测试时间
     * @author xx
     * @date  2024-04-07
     */
    public function uploadTimeTest(){
        $file   = $this->request->file('file');
        $tel    = $this->getAdminTel();
        $data['file'] = $file;
        $data['tel'] = $tel;
        return    (new TestTimeLogic())->uploadExcelTest($data);
    }


    /**
     * @desc  测试创建面单
     * @author xx
     * @date  2024-04-07
     */
    public function orderShippingDocumentsQueueConsume(){
        $data   = $this->request->post();
        $res    =  (new OrderDocumentServiceLogic())->orderShippingDocumentsQueueConsume($data);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }


    /**
     * @desc  测试创建面单
     * @author xx
     * @date  2024-04-07
     */
    public function track_register(){
        $data   = $this->request->post();
        $res    = (new TrackLogic())->track_register($data);
        return $this->jsonMessage(200, true, "推送成功!", $res);
    }





}